#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    bool CheckPermutation(string s1, string s2) {
        unordered_map<char, int> hash;
        for (auto e : s1) hash[e]++;
        for (auto e : s2)
        {
            if (hash.count(e))
            {
                hash[e]--;
            }
            else
            {
                return false;
            }
        }
        for (auto e : s1)
        {
            if (hash[e] != 0)
            {
                return false;
            }
        }
        return true;
    }
};